﻿using Scoot.Data;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Scoot.Services.Members
{
    public class MemberModel
    {
        public Guid ID { get; set; }

        [Required]
        [StringLength(200)]
        public string Name { get; set; }

		[Display(Name = "Active Member?")]
        public bool IsActive { get; set; }
    }

	static class Transforms
	{
		public static Expression<Func<Member, MemberModel>> EntityToModel = (m) => new MemberModel
		{
			ID = m.MemberPK,
			Name = m.Name,
			IsActive = m.IsActive
		};

		public static Func<MemberModel, Member> ModelToEntity = (m) => new Member
		{
			Name = m.Name,
			IsActive = m.IsActive
		};
	}
}
